from . import views
from django.conf.urls import url
from  rest_framework.routers import DefaultRouter

urlpatterns = [
    url(r'^categories/(?P<pk>\d+)/$', views.CategoriesView.as_view()),
    url(r'^categories/(?P<pk>\d+)/skus/$', views.SKUSView.as_view()),
]

#定义路由
#通过REST framework的router来定义路由
router = DefaultRouter()
router.register('skus/search',views.SKUSearchView,base_name='skus_search')

urlpatterns += router.urls